package Month07.day25;

import java.util.ArrayList;

public class TestArrayList {
    public static void main(String[] args) throws ListNUllException {
        ArrayList<String> list = new ArrayList<>();
        list.add("s");
        list.add("b");
        String s=getnum(list,1);
        System.out.println(s);
    }

    private static String getnum(ArrayList<String> list,int index) throws ListNUllException {
        if (list==null){
            throw new ListNUllException("数组为空");
        }
        return list.get(index);
    }
}
